public class ArrayHelper {
    public static boolean equal( int[] first , int[] second ) {  
      if(first.length==second.length){
        for(int i=0;i<first.length-1;i++) {
            if(first[i]==second[i]){
                continue;
            }
            else return false;
         }
      }
      else return false; 
      return true;
    }


    public static void main(String[] args) {
        int[] array1={1,2,3,4,5,6,7,8};
        int[] array2={1,2,3,4,5,6,7,8,};
        int[] array3={1,2,3,4,5,6,7,8,9};
        System.out.println(equal(array1,array2)?"两数组相同":"两数组不同");
        System.out.println(equal(array1,array3)?"两数组相同":"两数组不同");
    }    
}